package leave;

public class LeaveStudent {
    private String name;
    private int id;
    //院系
    private String department;
    private boolean isLeave;

    public void setLeave(boolean leave) {
        isLeave = leave;
    }

    public boolean isLeave() {
        return isLeave;
    }

    public LeaveStudent(){};

    public LeaveStudent(String name,int id,String department,boolean isLeave) {
        this.name = name;
        this.id = id;
        this.department = department;
        this.isLeave = isLeave;
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getDepartment() {
        return department;
    }

    public void setDepartment(String department) {
        this.department = department;
    }



    //重写了toString方法
    @Override
    public String toString() {
        return "LeaveStudent{" +
                "name='" + name + '\'' +
                ", id=" + id +
                ", department='" + department + '\'' +
                ", leaveTime="
//                + isLeave +
                  +(isLeave == true ?"此同学已离校":"此同学未离校")+
                '}';
    }
}
